32 on 64: Don't lock up Xen if you need to do lots of grant operations
authorSteven Smith <ssmith@xensource.com>
Fri, 27 Apr 2007 12:25:58 +0000 (13:25 +0100)
committerSteven Smith <ssmith@xensource.com>
Fri, 27 Apr 2007 12:25:58 +0000 (13:25 +0100)
in a single batch for a 32-on-64 domain.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
xen/common/compat/grant_table.c

index b08044711032d8e94637480ec6abbe55031d3bc8..aea0bfe78eba624dc66f23829e93ac8a7736ef3c 100644 (file)
@@ -133,7 +133,7 @@ int compat_grant_table_op(unsigned int cmd,
             break;
 
         case GNTTABOP_transfer:
-            for ( n = 0; i < COMPAT_ARG_XLAT_SIZE / sizeof(*nat.xfer) && i < count && rc == 0; ++i, ++n )
+            for ( n = 0; n < COMPAT_ARG_XLAT_SIZE / sizeof(*nat.xfer) && i < count && rc == 0; ++i, ++n )
             {
                 if ( unlikely(__copy_from_guest_offset(&cmp.xfer, cmp_uop, i, 1)) )
                     rc = -EFAULT;
@@ -160,7 +160,7 @@ int compat_grant_table_op(unsigned int cmd,
             break;
 
         case GNTTABOP_copy:
-            for ( n = 0; i < COMPAT_ARG_XLAT_SIZE / sizeof(*nat.copy) && i < count && rc == 0; ++i, ++n )
+            for ( n = 0; n < COMPAT_ARG_XLAT_SIZE / sizeof(*nat.copy) && i < count && rc == 0; ++i, ++n )
             {
                 if ( unlikely(__copy_from_guest_offset(&cmp.copy, cmp_uop, i, 1)) )
                     rc = -EFAULT;